A script is a sequence of commands. ZTerm scripts are stored in TEXT files, which you can create with a text editor or most word processors (you must save the file in a TEXT only format). A script may be run from the メRun a Scriptモ menu command, or by a macro string or automatically run by the dialer when you connect to a service. If a macro string starts with ィ (Option-R) followed by the name of a script file, that script file will be run when you select that macro (from the Macro menu or with Command - number). For example, I could set a macro label to メRead Newモ and set the macro string to メィreadnew.ztsモ and when I select Read New from the Macros menu it would run the readnew.zts script file. You can stop a running script by holding down the Command key and pressing the period key. ZTerm looks in the ZTerm directory for script files. It also looks in a folder called メZTerm Scriptsモ in the ZTerm directory.
Logon Scripts
When ZTerm connects to a service, it will look for a text file with the same name as the service with a メ.ztsモ on the end. For GEnie, it will look for a file called メGEnie.ztsモ in the ZTerm folder. If it finds a file, it will run the script.
String constants can use any form of quote: "one", 'two', メthreeモ, ヤfourユ
Control characters in a string constant are specified with the ^ (carat) followed by the letter: "^M" is control-M, which is the Return character. Other control characters:
^@ - NUL
^G - BELL
^H - Backspace
^I - Tab
^J - Line feed
^L - Form feed
^M - Carriage return
^Q - XON (resume data flow)
^S - XOFF (suspend data flow)
^[ - Escape
Built-in variables
$Account - string in the connection dialog
$Password - string in connection dialog
$Service - name of current service
$Phone - phone number for current service
$Date - in the short format
$Time - in hours, minutes and seconds (hh:mm:ss)
$hh_mm - time in hh_mm format (can be used to make a unique file name)
$Day, $dd - day of month ($dd has zero fill)
$mm - month
$year
$yy - low two digits of year
Script Commands
Beep
Beep <duration> -- if you are using the simple beep, you can give a duration.
Beep 4 ticks
Close capture -- close the capture file.
Display <string(s)> -- display text in the terminal window
Display メConnected at モ $time
Hangup -- hangup the modem (same as the menu command)
Open capture <capture file name> -- start capturing data to a file.
Open capture "GEnie.log"
Open capture メInternet.log.モ $date メ.モ $hh_mm
(this would open a capture file named like メInternet.log.9/29/94.22_50モ)